<?php  

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class branch extends CI_Controller {
	function __construct()
	{
			parent::__construct();
		// check if salesman logged in 
		if (!$this->ion_auth->logged_in())
	  	{
			redirect('auth/login');
	  	}		
		$this->load->library('form_validation');
		$this->load->model('purchase/purchase_model');
		$this->load->library('ion_auth');
		$this->load->library('session');
		
		$this->load->library('form_validation');
		$this->load->helper('url');

		// Load MongoDB library instead of native db driver if required
		$this->config->item('use_mongodb', 'ion_auth') ?
		$this->load->library('mongo_db') :

		$this->load->database();

		$this->form_validation->set_error_delimiters($this->config->item('error_start_delimiter', 'ion_auth'), $this->config->item('error_end_delimiter', 'ion_auth'));

	}
		
	

function view_branch_product(){
	
		$this->data['users'] = $this->product_model->get_branch_product()->result();
		print_r($this->data['users']);exit;
		$meta['page_title'] = "Purchases";
	   $this->data['message'] = "Purchases";
	   $this->load->view('common/header', $meta);
	   $this->load->view('purchase/view_purchase',$this->data);
       $this->load->view('common/footer');	
}

}

?>
